Skip to content

fix: reaction list shows blank entries when UI_Use_Real_Name is enabled - #41574

Merged
dionisio-bot[bot] merged 5 commits into
developfrom
feat/resolve-reaction-real-names
Aug 4, 2026
Merged

fix: reaction list shows blank entries when UI_Use_Real_Name is enabled#41574
dionisio-bot[bot] merged 5 commits into
developfrom
feat/resolve-reaction-real-names

Conversation

@Rohit3523

@Rohit3523 Rohit3523 commented Jul 25, 2026

Copy link
Copy Markdown
Member

Proposed changes

Resolves real names for message reactions in the broadcast pipeline. When UI_Use_Real_Name is enabled, the server now enriches each reaction with a names array containing the display names of users who reacted.

Previously only the message author (message.u.name) and mentions (mentions[].name) were resolved. This change extends the same pattern to reactions using a batch query (Users.findByUsernames) instead of per-username lookups.

Issue(s)

https://rocketchat.atlassian.net/browse/NATIVE-1047

Steps to test or reproduce

Web

  1. Enable UI_Use_Real_Name in admin settings
  2. Hover over a reaction to see the tooltip — real names should appear instead of usernames
  3. Click the reaction list from the message menu — real names should be displayed

Mobile app

  1. Open any channel in the mobile app
  2. React to any message
  3. Long-press a reaction to open the reaction list
  4. It should display names instead of blank entries

Note: Current behaviour differs by platform:

  • Web: Usernames are shown instead of real names.
  • Mobile: The reaction list shows blank entries.

Further comments

Uses a single batch query (Users.findByUsernames) to resolve all reaction usernames at once, deduplicated via Set, with a fallback to username when a user has no display name set.

Review in cubic

Summary by CodeRabbit

Summary by CodeRabbit

  • Enhancements
    • Reaction items in broadcast messages are now enriched with users’ display names when the real-name setting is enabled.
    • Uses a batch lookup to resolve reaction usernames to display names (falling back to the original username when no match is found).
  • Bug Fixes
    • Fixes incorrect, blank, or username-only reaction entries in the reaction list modal when real-name display is enabled (especially on mobile).
  • Tests
    • Added unit test coverage for reaction name resolution under the real-name setting, including ensuring the lookup is skipped when reactions are empty.

@Rohit3523
Rohit3523 requested a review from a team as a code owner July 25, 2026 22:09
@dionisio-bot

dionisio-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f3121f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f042fb01-9b0e-4201-b443-c4ac3f13448d

📥 Commits

Reviewing files that changed from the base of the PR and between f3121f1 and a81ebaa.

📒 Files selected for processing (1)
  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Hacktron Security Check
⚠️ CI failures not shown inline (5)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ❌ **QA assured** — This PR is missing the 'stat: QA assured' label
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

Walkthrough

getMessageToBroadcast resolves reaction usernames to user names through a cached bulk lookup when real-name display is enabled. Unit tests mock this lookup and verify reaction names alongside sender and mention name resolution.

Changes

Reaction Real-Name Mapping

Layer / File(s) Summary
Broadcast reaction name resolution
apps/meteor/server/lib/notifyListener.ts, .changeset/wet-turtles-fix.md
Collects unique reaction usernames, fetches matching user names, rewrites reaction names with resolved names or username fallbacks, and records the patch release fix.
Reaction mapping test coverage
apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
Adds the bulk-user lookup stub and verifies reaction name resolution, deduplication, projections, and empty-reaction behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main fix: reaction list entries were blank when UI_Use_Real_Name was enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • NATIVE-1047: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label Jul 25, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/meteor/tests/unit/server/lib/notifyListener.spec.ts (1)

105-126: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Assert the deduplicated bulk lookup contract.

This fixture has no repeated username, and the stub ignores its arguments, so regressions to duplicate or per-reaction lookups still pass. Add a repeated username and assert one findByUsernames call with unique usernames and { projection: { username: 1, name: 1 } }.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/unit/server/lib/notifyListener.spec.ts` around lines 105 -
126, Update the “useRealName” reaction fixture to repeat a username across
reactions, then assert the real-name lookup invokes findByUsernames exactly once
with the deduplicated usernames and projection { username: 1, name: 1 }. Ensure
the stub verifies its arguments so duplicate or per-reaction lookups fail the
test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/meteor/tests/unit/server/lib/notifyListener.spec.ts`:
- Around line 105-126: Update the “useRealName” reaction fixture to repeat a
username across reactions, then assert the real-name lookup invokes
findByUsernames exactly once with the deduplicated usernames and projection {
username: 1, name: 1 }. Ensure the stub verifies its arguments so duplicate or
per-reaction lookups fail the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 66a43562-3f7f-441c-b327-a942d080d2e3

📥 Commits

Reviewing files that changed from the base of the PR and between 6dc66fb and 695236c.

📒 Files selected for processing (2)
  • apps/meteor/server/lib/notifyListener.ts
  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: ⚙️ Variables Setup
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/server/lib/notifyListener.ts
  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
🧠 Learnings (5)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/server/lib/notifyListener.ts
  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/server/lib/notifyListener.ts
  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/server/lib/notifyListener.ts
  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/unit/server/lib/notifyListener.spec.ts
🔇 Additional comments (2)
apps/meteor/server/lib/notifyListener.ts (1)

471-478: LGTM!

apps/meteor/tests/unit/server/lib/notifyListener.spec.ts (1)

9-9: LGTM!

Also applies to: 33-33, 49-49, 212-227

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.68%. Comparing base (6dc66fb) to head (a81ebaa).
⚠️ Report is 64 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41574      +/-   ##
===========================================
- Coverage    68.69%   68.68%   -0.01%     
===========================================
  Files         4139     4139              
  Lines       159112   159278     +166     
  Branches     27917    27883      -34     
===========================================
+ Hits        109300   109405     +105     
- Misses       44666    44711      +45     
- Partials      5146     5162      +16     
Flag Coverage Δ
e2e 58.84% <ø> (+0.01%) ⬆️
e2e-api 45.58% <10.00%> (-0.03%) ⬇️
unit 70.65% <80.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nazabucciarelli

Copy link
Copy Markdown
Contributor

Is it a regression related to the unicode emojis PR? The changeset says Fixes but the prefix of the PR is feat:, maybe you forgot to update the title

@Rohit3523 Rohit3523 changed the title feat: resolve real names for message reactions when UI_Use_Real_Name is enabled fix: resolve real names for message reactions when UI_Use_Real_Name is enabled Jul 27, 2026
@Rohit3523

Copy link
Copy Markdown
Member Author

It is not a regression related to unicode emoji, and yeah i have update the title, Thanks

@nazabucciarelli nazabucciarelli added this to the 8.8.0 milestone Jul 27, 2026
@Rohit3523 Rohit3523 changed the title fix: resolve real names for message reactions when UI_Use_Real_Name is enabled fix: reaction list shows blank entries when UI_Use_Real_Name is enabled Jul 27, 2026
Comment thread apps/meteor/server/lib/notifyListener.ts Outdated
@coderabbitai coderabbitai Bot added type: bug and removed type: feature Pull requests that introduces new feature labels Jul 27, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread apps/meteor/server/lib/notifyListener.ts
@FragaKrummenauer FragaKrummenauer added the stat: QA assured Means it has been tested and approved by a company insider label Aug 4, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Aug 4, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Aug 4, 2026
Merged via the queue into develop with commit 2d8a6f7 Aug 4, 2026
98 of 101 checks passed
@dionisio-bot
dionisio-bot Bot deleted the feat/resolve-reaction-real-names branch August 4, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants